package ru.amse.ilyin.gui;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JComponent;
import javax.swing.border.BevelBorder;

class StatusBar extends JComponent {
	private String text = "Statusbar";
	
	/**
	 * Creates a statusbar.
	 */
	public StatusBar() {
		setPreferredSize(new Dimension(100, 20));
		setBorder(new BevelBorder(BevelBorder.LOWERED));
	}
	
	/**
	 * Sets statusbar text.
	 * 
	 * @param text text to be set
	 */
	public void setText(String text) {
		this.text = text;
		repaint();
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		g.drawString(text, 5, 15);
	}
}
